<?php
namespace app\validate;

use think\Validate;

class User extends Validate
{
	protected $rule = [
        'username|学名'  =>  'require|chsAlphaNum|length:3,20',
        'email|邮箱' =>  'require|email|unique:user',
        'password|密码' => 'require|alphaDash|length:6,20',
        'repassword|确认密码' => 'require|confirm:password'
    ];

    //验证场景
    /**
     * 添加学名的场景
     */
    public function sceneAdd(){
    	return $this->only(['username','password','repassword','email']);
    }
}